#! /usr/bin/env python
# -*- coding: utf-8 -*-

# *************************************************************
#  Copyright (c) JoinQuant Development Team
#
#  Author: Huayong Kuang <kuanghuayong@joinquant.com>
#  CreateTime: 2017-09-05 17:04:24 Tuesday
# *************************************************************

from __future__ import print_function

from cached_property import cached_property


class Foo1(object):

    @cached_property
    def aa(self):
        print('-' * 10)
        return 1 + 1

    def test(self):
        print(1)


class Foo2(Foo1):

    def call_test(self):
        self.test()
        print(self.aa)
        print("in Foo2")


class Foo3(Foo2):

    def test(self):
        print(3)


class Foo4(Foo1):

    def test2(self):
        print(self.aa)

class Foo5(Foo1):

    def test3(self):
        f2 = Foo2()
        f4 = Foo4()

        f2.call_test()
        f4.test2()


# Script starts from here

if __name__ == "__main__":
    # f3 = Foo3()
    # f3.call_test()
    f5 = Foo5()
    f5.test3()
